﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace FinalProject
{
    public partial class Site : System.Web.UI.MasterPage
    {                
        public string labelText1
        {
            get { return lblUser.Text; }
            set { lblUser.Text = value; }
        }

        public Site()
        {
            //lbtDangXuat.Click += new EventHandler(lbtDangXuat_Click);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] != null)
            {
                lblUser.Text = "Chào " + Session["username"].ToString();
                lbtDangXuat.Text = " | Đăng xuất";
            }

            lbtDangXuat.Click += new EventHandler(lbtDangXuat_Click);
        }

        void lbtDangXuat_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            Session["username"] = null;
            lbtDangXuat.Visible = false;
            lblUser.Visible = false;
            Response.Redirect("Home.aspx");
        }
            

    }
}
